package com.bcbim.authentication.application.service;

import com.bcbim.authentication.application.mapper.ApplicationMapper;
import com.bcbim.authentication_interface.application.bo.ApplicationBO;
import com.bcbim.authentication_interface.application.dao.ApplicationDAO;
import com.bcbim.authentication_interface.application.service.ApplicationService;
import com.bcbim.authentication_interface.application.vo.ApplicationVO;
import org.apache.dubbo.config.annotation.Service;
import org.springframework.beans.factory.annotation.Autowired;

/**
 * @Description: 应用接口
 * @Author: ye
 * @Date: 2022/4/6
 * @Version: V1.0
 **/
@Service(timeout = 60 * 1000, group = "application", version = "1.0.0")
public class ApplicationServiceImpl implements ApplicationService {

    @Autowired
    private ApplicationMapper applicationMapper;

    /**
     * @Description: 校验key合法性
     * @Param: appKey
     * @Return: ApplicationDAO
     * @Author: ye
     * @Date: 2022/4/6
     */
    @Override
    public ApplicationBO checkAppKey(String appKey) {
        return applicationMapper.checkAppKey(appKey);
    }

    /**
     * @Description: 查询用户应用信息
     * @Param: userId
     * @Return: ApplicationVO
     * @Author: ye
     * @Date: 2022/7/8
     */
    @Override
    public ApplicationVO getUserApplication(String userId) {
        return applicationMapper.getUserApplication(userId);
    }
}
